package com.oxygen.pt.controller;

import com.oxygen.pt.pojo.vo.Result;
import com.oxygen.pt.pojo.vo.TreatmentStatisticsVO;
import com.oxygen.pt.service.HyperbaricChamberService;
import com.oxygen.pt.service.TreatmentStatisticsService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController()
@RequestMapping("/chamber")
@Slf4j
public class HyperbaricChamberController {
    @Resource
    private HyperbaricChamberService hyperbaricChamberService;
    @Resource
    private TreatmentStatisticsService treatmentStatisticsService;

    /**
     * 获取氧舱使用状况
     * @return 相关VO的list
     */
    @GetMapping("/getUsageStates")
    public Result<Object> getUsageStates(){
        return hyperbaricChamberService.getStates();
    }

    /**
     * 获取当日治疗情况
     * @return 当日治疗情况的VO
     */
    @GetMapping("/getTreatmentStatistics")
    public Result<Object> getTreatmentStatistics(){
       TreatmentStatisticsVO res =  treatmentStatisticsService.getTreatmentStatisticsByDate();
        return Result.success(res);
    }
}
